setAlpha

open fun setAlpha(view: View, @FloatRange(from = 0.0, to = 1.0) value: Float)(source)

Deprecated

Use setAlpha directly.

Sets the opacity of the view. This is a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque.

Note that setting alpha to a translucent value (0 <1) can have significant performance implications, especially for large views. It is best to use the alpha property sparingly and transiently, as in the case of fading animations.

Parameters

view

view to set the alpha on.

value

The opacity of the view.